﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TaiwuZD
{
    /// <summary>
    /// FeatureCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class FeatureCtrl : UserControl
    {
        public FeatureCtrl()
        {
            InitializeComponent();
        }

        private void RemoveTxClick(object sender, MouseButtonEventArgs e)
        {
            var rf = (e.Source as ListViewItem).Content as ActorFeature;
            if (rf != null)
                Global.Inst.CurrentRole.RoleFeatures.Remove(rf);
        }

        private void AddTxClick(object sender, MouseButtonEventArgs e)
        {
            var rf = (e.Source as ListViewItem).Content as ActorFeature;
            if (rf != null && !Global.Inst.CurrentRole.RoleFeatures.Contains(rf))
                Global.Inst.CurrentRole.RoleFeatures.Add(rf);
        }

    }
}
